﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.DirectoryServices;


namespace ITSupportPlatform
{
    public partial class _Default : System.Web.UI.Page
    {
        public string ClientScript { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.FounderOAResourceGroupEntities context = new DAL.FounderOAResourceGroupEntities();
            string domainAndName = Page.User.Identity.Name;//读取域登录用户名，格式为Domainname\username （域名名称\用户名称） 
            DAL.Org_Users info = context.Org_Users.Where(x => x.LoginID.ToLower() == domainAndName.ToLower()).SingleOrDefault();
            if (info==null)
            {
                Response.Clear();
                Response.Write("<script>alert('请联系本公司信息接口人将您的用户信息加入OA后重试');<script/>");
            }
            if (info.DeptID.Value.ToString().ToUpper()=="74661AB1-E55A-49E1-AB59-BD047227EC6C")
            {
               // CommonUser.Visible = false;
                ClientScript = "LoadUserProcessTask(0); LoadUserProcessTask(1);InitGroupTasks();InitGroupFinishTasks();";
            }
            else
            {
                ErpUser.Visible = false;
                //ClientScript = "LoadUserTask();";
            }
        }
    }
}
